package day16_Runnable.demo07_ExecutorService;

//线程池:
//	写法:创建多个线程
//		ExecutorService threadPool = Executors.newFixedThreadPool(8);
//	启动线程
//		threadPool.submit(Runnable对象)
//	关闭线程池
//		threadPool.shutdown();

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;
import java.util.concurrent.Future;

public class Test1 {
    public static void main(String[] args) throws Exception{
        ExecutorService executorService = Executors.newFixedThreadPool(4);
        ExecutorService1 executorService1 = new ExecutorService1();
        for (int i = 1; i <=4; i++) {
            executorService.submit(executorService1);
        }
        executorService.shutdown();
    }
}
